// See https://aka.ms/new-console-template for more information
using System.Security.Cryptography;
using PasswordHasher;

//var hash = Argon2Test.HashPassword2("123456");
//var isMatch = Argon2Test.Verify("123456", hash);
//var isMatch2 = Argon2Test.IsMatch("123456", hash);

//Console.WriteLine($"hash:{hash}");
//Console.WriteLine($"isMatch:{isMatch}");
//Console.WriteLine($"isMatch2:{isMatch2}");

var salt = new byte[16];
RandomNumberGenerator.Fill(salt); // 生成随机盐
var hash = Argon2TestWithNesc.HashPassword("123456", new ReadOnlySpan<byte>(salt));
var hash2 = Argon2TestWithNesc.HashPassword("123456", new ReadOnlySpan<byte>(salt));
Console.WriteLine($"hash:{hash}");
Console.WriteLine($"isMatch:{hash.Equals(hash2)}");
